<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/page/common/head.jsp"%>
        <div class="right">
            <div class="location">
                <strong>当前位置:</strong>
                <span>用户管理页面</span>
            </div>
            <div class="search">
           		<form method="get" action="${pageContext.request.contextPath }/sys/user/list">
					 <span>用户名：</span>
					 <input name="queryRealName" class="input-text"	type="text" value="${queryRealName}">

					 <span>角色：</span>
					 <select name="queryRoleId">
						<c:if test="${roleList != null }">
						   <option value="">--全部--</option>
						   <c:forEach var="role" items="${roleList}">
						   		<option <c:if test="${role.id == queryRoleId }">selected="selected"</c:if>
						   		value="${role.id}">${role.name}</option>
						   </c:forEach>
						</c:if>
	        		</select>

					 <input type="hidden" name="pageIndex" value="1"/>
					 <input	value="查 询" type="submit" id="searchbutton">
					 <a href="${pageContext.request.contextPath}/SysUserToAdd" >添加</a>
				</form>
            </div>
            <!--用户-->
            <table class="supplierTable" cellpadding="0" cellspacing="0">
                <tr class="firstTr">
                    <th width="15%">账号</th>
                    <th width="15%">真实姓名</th>
                    <th width="10%">角色</th>
                    <th width="10%">性别</th>
                    <th width="10%">出生日期</th>
                    <th width="10%">电话</th>
                    <th width="30%">操作</th>
                </tr>
                   <c:forEach var="user" items="${pageInfo.list }" varStatus="status">
					<tr>
						<td>
						<span>${user.account }</span>
						</td>
						<td>
						<span>${user.realName }</span>
						</td>
						<td>
							<span>${user.rolename}</span>
						</td>
						<td>
							<span>
								<c:if test="${user.sex==0}">女</c:if>
								<c:if test="${user.sex==1}">男</c:if>
							</span>
						</td>
						<td>
						<span><fmt:formatDate value="${user.birth}" pattern="yyyy-MM-dd"></fmt:formatDate> </span>
						</td>
						<td>
						<span>${user.tel}</span>
						</td>
						<td>
						<span><a class="viewUser" href="${pageContext.request.contextPath}/lookoverUser/${user.id}" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/view.png" alt="查看" title="查看"/></a></span>
						<span><a class="modifyUser" href="${pageContext.request.contextPath}/SysUserUpdate/${user.id}" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/upd.png" alt="修改" title="修改"/></a></span>
						<span><a class="deleteUser" onclick="deleteById('/SysUserDelete/',${user.id})" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/del.png" alt="删除" title="删除"/></a></span>
						</td>
					</tr>
				</c:forEach>
			</table>
			<div class="page-bar">
				<ul class="page-num-ul clearfix">
					<li>共${pageInfo.total}条记录&nbsp;&nbsp; ${pageInfo.pageNum}/${pageInfo.pages}页&nbsp;&nbsp;&nbsp;&nbsp;</li>
					<c:if test="${!pageInfo.isFirstPage}">
						<a href="${pageContext.request.contextPath}/sys/user/list?pageIndex=1&queryRealName=${queryRealName}&queryRoleId=${queryRoleId}">首页</a>
						<a href="${pageContext.request.contextPath}/sys/user/list?pageIndex=${pageInfo.pageNum-1}&queryRealName=${queryRealName}&queryRoleId=${queryRoleId}">上一页</a>
					</c:if>
					<c:if test="${!pageInfo.isLastPage}">
						<a href="${pageContext.request.contextPath}/sys/user/list?pageIndex=${pageInfo.pageNum+1}&queryRealName=${queryRealName}&queryRoleId=${queryRoleId}">下一页</a>
						<a href="${pageContext.request.contextPath}/sys/user/list?pageIndex=${pageInfo.pages}&queryRealName=${queryRealName}&queryRoleId=${queryRoleId}">尾页</a>&nbsp;&nbsp;
					</c:if>
					</ul>
				<span class="page-go-form"><label>跳转至</label>
	     <input type="text" name="inputPage" id="inputPage" class="page-key" />页
		 <button type="button" onclick="goindex('/sys/user/',${pageInfo.pages})" class="page-btn" >GO</button>
    </span>
			</div>

<!--点击删除按钮后弹出的页面-->
<%@include file="/WEB-INF/page/common/foot.jsp" %>

